package com.schoolpro.controller;


import com.schoolpro.pojo.DTO.ItemAddDTO;
import com.schoolpro.pojo.Result;
import com.schoolpro.service.ItemService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
* @author : Hinton
* @时间 : 2月 05 22:12
*/


@Slf4j
@RestController
@RequestMapping("/item")
@Tag(name = "表项管理")
public class ItemController {

    @Autowired
    private ItemService itemService;

    /**
     * 添加表项
     * @param itemAddDTO
     * @return
     */
    @PostMapping("/add")
    public Result<Object> addItem(@RequestBody List<ItemAddDTO> itemAddDTOList) {
        itemService.addItemBatch(itemAddDTOList);
        return Result.success();
    }

}
